---
title: Run the application
description: How to run the application locally.
---

Once you have cloned the repository and installed the dependencies, you can run
the application with the following commands:

```bash
pnpm init:env
```

This will generate a new `.env` file in the root directory and create a symlink
to `apps/web/.env`.

Alternatively, you can copy the `.env.example` file to `.env` and fill in the
values.

```bash
cp .env.example .env

# MacOS/Linux
ln -s apps/web/.env .env

# Windows
mklink apps/web/.env .env
```

Then run the following command to start the local database and run database
migrations:

```bash
docker-compose up && pnpm db:migrate
```

To run the Vite application, run the following command:

```bash
pnpm dev:web
```

This will start the Vite application at `http://localhost:3000`.

## Authentication

The application uses Better Auth by default for authentication. Better Auth
requires an `AUTH_SECRET` environment variable to be set.

When using the CLI to generate the `.env` file, a secret is automatically
generated and set.

To generate a secret manually, run the following command:

```bash
openssl rand -base64 33
```

Now update the `AUTH_SECRET` environment variable in the `.env` file with the
generated secret.

You can now log in with your email address, the confirmation URL will be printed
in the console in case you haven't configured any email provider.

## Next steps

- [Configure Environment Variables](/docs/starter-kits/tanstack-start/configuration/environment-variables)
- [Configure email provider](/docs/starter-kits/tanstack-start/configuration/email-provider)
